package com.heima.article;

import com.heima.article.fallback.ArticleClientFallback;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.CommentConfigDto;
import com.heima.model.wemedia.dtos.PageCommentDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 陈辉
 * @data 2023 14:44
 */
@FeignClient(value = "leadnews-article", fallback = ArticleClientFallback.class)
public interface IArticleClient {

    /**
     * article文章同步接口
     *
     * @param articleDto
     * @return
     */
    @PostMapping("/api/v1/article/async")
    public ResponseResult saveOrUpdateArticle(@RequestBody ArticleDto articleDto);

    @PostMapping("/api/v1/article/comment")
    ResponseResult findNewsComments(@RequestBody PageCommentDto pageCommentDto);

    @PostMapping("/api/v1/article/updateArticleStatus")
    ResponseResult updateArticleStatus(@RequestBody CommentConfigDto dto);
}
